Integrand size = 23, antiderivative size = 64 \[ \int \frac {3+b \sin (e+f x)}{c+d \sin (e+f x)} \, dx=\frac {b x}{d}-\frac {2 (b c-3 d) \arctan \left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{d \sqrt {c^2-d^2} f} \]
[Out]
Time = 0.06 (sec) , antiderivative size = 65, normalized size of antiderivative = 1.02, number of steps used = 4, number of rules used = 4, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.174, Rules used = {2814, 2739, 632, 210} \[ \int \frac {3+b \sin (e+f x)}{c+d \sin (e+f x)} \, dx=\frac {b x}{d}-\frac {2 (b c-a d) \arctan \left (\frac {c \tan \left (\frac {1}{2} (e+f x)\right )+d}{\sqrt {c^2-d^2}}\right )}{d f \sqrt {c^2-d^2}} \]
[In]
[Out]
Rule 210
Rule 632
Rule 2739
Rule 2814
Rubi steps \begin{align*} \text {integral}& = \frac {b x}{d}-\frac {(b c-a d) \int \frac {1}{c+d \sin (e+f x)} \, dx}{d} \\ & = \frac {b x}{d}-\frac {(2 (b c-a d)) \text {Subst}\left (\int \frac {1}{c+2 d x+c x^2} \, dx,x,\tan \left (\frac {1}{2} (e+f x)\right )\right )}{d f} \\ & = \frac {b x}{d}+\frac {(4 (b c-a d)) \text {Subst}\left (\int \frac {1}{-4 \left (c^2-d^2\right )-x^2} \, dx,x,2 d+2 c \tan \left (\frac {1}{2} (e+f x)\right )\right )}{d f} \\ & = \frac {b x}{d}-\frac {2 (b c-a d) \arctan \left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{d \sqrt {c^2-d^2} f} \\ \end{align*}
Time = 0.16 (sec) , antiderivative size = 66, normalized size of antiderivative = 1.03 \[ \int \frac {3+b \sin (e+f x)}{c+d \sin (e+f x)} \, dx=\frac {b (e+f x)+\frac {(-2 b c+6 d) \arctan \left (\frac {d+c \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right )}{\sqrt {c^2-d^2}}}{d f} \]
[In]
[Out]
Time = 1.02 (sec) , antiderivative size = 76, normalized size of antiderivative = 1.19
method | result | size |
derivativedivides | \(\frac {\frac {2 b \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{d}+\frac {2 \left (d a -c b \right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{d \sqrt {c^{2}-d^{2}}}}{f}\) | \(76\) |
default | \(\frac {\frac {2 b \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{d}+\frac {2 \left (d a -c b \right ) \arctan \left (\frac {2 c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )+2 d}{2 \sqrt {c^{2}-d^{2}}}\right )}{d \sqrt {c^{2}-d^{2}}}}{f}\) | \(76\) |
risch | \(\frac {b x}{d}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}-c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) a}{\sqrt {-c^{2}+d^{2}}\, f}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}-c^{2}+d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) c b}{\sqrt {-c^{2}+d^{2}}\, f d}+\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}+c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) a}{\sqrt {-c^{2}+d^{2}}\, f}-\frac {\ln \left ({\mathrm e}^{i \left (f x +e \right )}+\frac {i c \sqrt {-c^{2}+d^{2}}+c^{2}-d^{2}}{\sqrt {-c^{2}+d^{2}}\, d}\right ) c b}{\sqrt {-c^{2}+d^{2}}\, f d}\) | \(282\) |
[In]
[Out]
none
Time = 0.29 (sec) , antiderivative size = 255, normalized size of antiderivative = 3.98 \[ \int \frac {3+b \sin (e+f x)}{c+d \sin (e+f x)} \, dx=\left [\frac {2 \, {\left (b c^{2} - b d^{2}\right )} f x + {\left (b c - a d\right )} \sqrt {-c^{2} + d^{2}} \log \left (\frac {{\left (2 \, c^{2} - d^{2}\right )} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2} + 2 \, {\left (c \cos \left (f x + e\right ) \sin \left (f x + e\right ) + d \cos \left (f x + e\right )\right )} \sqrt {-c^{2} + d^{2}}}{d^{2} \cos \left (f x + e\right )^{2} - 2 \, c d \sin \left (f x + e\right ) - c^{2} - d^{2}}\right )}{2 \, {\left (c^{2} d - d^{3}\right )} f}, \frac {{\left (b c^{2} - b d^{2}\right )} f x + {\left (b c - a d\right )} \sqrt {c^{2} - d^{2}} \arctan \left (-\frac {c \sin \left (f x + e\right ) + d}{\sqrt {c^{2} - d^{2}} \cos \left (f x + e\right )}\right )}{{\left (c^{2} d - d^{3}\right )} f}\right ] \]
[In]
[Out]
Leaf count of result is larger than twice the leaf count of optimal. 425 vs. \(2 (53) = 106\).
Time = 13.18 (sec) , antiderivative size = 425, normalized size of antiderivative = 6.64 \[ \int \frac {3+b \sin (e+f x)}{c+d \sin (e+f x)} \, dx=\begin {cases} \frac {\tilde {\infty } x \left (a + b \sin {\left (e \right )}\right )}{\sin {\left (e \right )}} & \text {for}\: c = 0 \wedge d = 0 \wedge f = 0 \\\frac {\frac {a \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} \right )}}{f} + b x}{d} & \text {for}\: c = 0 \\\frac {a x - \frac {b \cos {\left (e + f x \right )}}{f}}{c} & \text {for}\: d = 0 \\\frac {x \left (a + b \sin {\left (e \right )}\right )}{c + d \sin {\left (e \right )}} & \text {for}\: f = 0 \\\frac {2 a}{d f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - d f} + \frac {b f x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{d f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - d f} - \frac {b f x}{d f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - d f} + \frac {2 b}{d f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} - d f} & \text {for}\: c = - d \\- \frac {2 a}{d f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + d f} + \frac {b f x \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )}}{d f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + d f} + \frac {b f x}{d f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + d f} + \frac {2 b}{d f \tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + d f} & \text {for}\: c = d \\\frac {a \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {d}{c} - \frac {\sqrt {- c^{2} + d^{2}}}{c} \right )}}{f \sqrt {- c^{2} + d^{2}}} - \frac {a \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {d}{c} + \frac {\sqrt {- c^{2} + d^{2}}}{c} \right )}}{f \sqrt {- c^{2} + d^{2}}} - \frac {b c \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {d}{c} - \frac {\sqrt {- c^{2} + d^{2}}}{c} \right )}}{d f \sqrt {- c^{2} + d^{2}}} + \frac {b c \log {\left (\tan {\left (\frac {e}{2} + \frac {f x}{2} \right )} + \frac {d}{c} + \frac {\sqrt {- c^{2} + d^{2}}}{c} \right )}}{d f \sqrt {- c^{2} + d^{2}}} + \frac {b x}{d} & \text {otherwise} \end {cases} \]
[In]
[Out]
Exception generated. \[ \int \frac {3+b \sin (e+f x)}{c+d \sin (e+f x)} \, dx=\text {Exception raised: ValueError} \]
[In]
[Out]
none
Time = 0.30 (sec) , antiderivative size = 83, normalized size of antiderivative = 1.30 \[ \int \frac {3+b \sin (e+f x)}{c+d \sin (e+f x)} \, dx=\frac {\frac {{\left (f x + e\right )} b}{d} - \frac {2 \, {\left (\pi \left \lfloor \frac {f x + e}{2 \, \pi } + \frac {1}{2} \right \rfloor \mathrm {sgn}\left (c\right ) + \arctan \left (\frac {c \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + d}{\sqrt {c^{2} - d^{2}}}\right )\right )} {\left (b c - a d\right )}}{\sqrt {c^{2} - d^{2}} d}}{f} \]
[In]
[Out]
Time = 10.63 (sec) , antiderivative size = 342, normalized size of antiderivative = 5.34 \[ \int \frac {3+b \sin (e+f x)}{c+d \sin (e+f x)} \, dx=\frac {2\,b\,\mathrm {atan}\left (\frac {\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )}{d\,f}+\frac {c\,\left (b\,\ln \left (\frac {d\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+c\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {d^2-c^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {-\left (c+d\right )\,\left (c-d\right )}-b\,\ln \left (\frac {d\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+c\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {d^2-c^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {d^2-c^2}\right )-a\,d\,\ln \left (\frac {d\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+c\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )-\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {d^2-c^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {-\left (c+d\right )\,\left (c-d\right )}+a\,d\,\ln \left (\frac {d\,\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )+c\,\sin \left (\frac {e}{2}+\frac {f\,x}{2}\right )+\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )\,\sqrt {d^2-c^2}}{\cos \left (\frac {e}{2}+\frac {f\,x}{2}\right )}\right )\,\sqrt {d^2-c^2}}{d\,f\,\left (c^2-d^2\right )} \]
[In]
[Out]